<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/FoodSageTemplateUnauthenticated.xhtml">
    <h:head>
        <title> Preview generated for #{stakeholderPreviewManagedBean.stakeholderAccountState.username}</title>

    </h:head>

    <ui:define name="content">
        <h:form>
            <f:view beforePhase="#{stakeholderPreviewManagedBean.initView}">


                <p:panel header="#{stakeholderPreviewManagedBean.stakeholderAccountState.corpName}" style="width: inherit; text-align: center;">

                    <h:outputLabel value="#{bundle['english.locale']}" style="color: red; font-size: 10px;"/>
                    <br/>

                    <table cellpadding="2" cellspacing="2">
                        <tr>
                            <td><p:graphicImage id="imagePreview" value="#{stakeholderPreviewManagedBean.stakeholderAccountState.imgUrl}" style="width: 550px; height: 270px; 
                                                position: static; float: left;"/></td>
                            <td valign="top" width="390px"> 
                                <h:outputText value="#{bundle['stakeholder.portal.aboutUs']}" style="width: inherit; 
                                              font-weight: bold; font-size: 20px; text-align: center;"/>
                                <br/><br/>
                                <p:inplace editor="true" label="#{stakeholderPreviewManagedBean.stakeholderAccountState.stakeholderDesc} "  
                                           onEditUpdate="msgs" style="width:390px; text-align: justify; float: left; font-size: 13px;"> 
                                    <p:inputTextarea id="sDesc" value="#{stakeholderPreviewManagedBean.stakeholderAccountState.stakeholderDesc}"
                                                     style="width:390px; height:230px; position: static; text-align: left;" required="true"/>
                                </p:inplace>

                            </td>
                        </tr>  
                        <tr>
                            <td>
                                <!--file upload-->

                            </td>
                            <td>
                                <p:commandButton actionListener="#{pageRedirectorBean.goStakeholderAccountPage}" value="#{bundle['btn.backPortal']}"
                                                 style="float: right;"/>
                                <p:commandButton actionListener="#{stakeholderPreviewManagedBean.saveStakeholderPortalInfo}" 
                                                 update="statusMessages" value="#{bundle['btnSave']}" 
                                                 style="float:right;"/>

                                <p:growl id ="statusMessages" />

                            </td>

                        </tr>

                    </table>

                    <br/>

                    <br/>


                    <p:separator /> 
                    <center>
                        <p:panel id="viewAllBranchesPanel" header="#{bundle['branch.viewallbranches.panel']}">


                            <p:dataTable var="localizedState" value="#{viewBranchManagedBean.branchList}" emptyMessage="#{bundle['branch.viewtallbranch.datatable']}"
                                         style="width: 800px;">  
                                <p:column style="width:25px">  
                                    <p:rowToggler />  
                                </p:column>  

                                <p:column headerText="#{bundle['branch.name.label']}">  
                                    <h:commandLink value="#{localizedState.branchName}" actionListener="#{stakeholderPreviewManagedBean.view_BranchPage(localizedState)}"/>  
                                </p:column>        

                                <p:column headerText="#{bundle['branch.postalcode.label']}">  
                                    <h:outputText value="#{localizedState.branchAddress.postalCode}" />  
                                </p:column>

                                <p:column headerText="#{bundle['branch.streetname.label']}" >  
                                    <h:outputText value="#{localizedState.branchAddress.streetName}" />  
                                </p:column> 


                                <p:column headerText="#{bundle['branch.fnbtype.label']}">  
                                    <h:outputText value="#{localizedState.localizedFnbType}" />  
                                </p:column> 

                                <p:rowExpansion>  
                                    <h:panelGrid id="display" columns="2" cellpadding="4" columnClasses="label, value">  
                                        <h:outputText style="font-weight: bold" value="#{bundle['branch.contactperson.label']}:" /> 
                                        <h:outputText value="#{localizedState.contactPerson}" />
                                        <h:outputText style="font-weight: bold" value="#{bundle['branch.contactnumber.label']}:" /> 
                                        <h:outputText value="#{localizedState.contactNumber}" />
                                        <h:outputText style="font-weight: bold" value="#{bundle['branch.emailaddress.label']}:" /> 
                                        <h:outputText value="#{localizedState.emailAddress}" />
                                        <h:outputText style="font-weight: bold" value="#{bundle['branch.unitnumber.label']}:" /> 
                                        <h:outputText value="#{localizedState.branchAddress.unitNumber}" />
                                        <h:outputText style="font-weight: bold" value="#{bundle['branch.blocknumber.label']}:" /> 
                                        <h:outputText value="#{localizedState.branchAddress.houseNumber}" />
                                        <h:outputText style="font-weight: bold" value="#{bundle['branch.buildingname.label']}:" /> 
                                        <h:outputText value="#{localizedState.branchAddress.buildingName}" />

                                        <h:outputText style="font-weight: bold" value="#{bundle['branch.halaltype.label']}:" /> 
                                        <h:outputText value="#{localizedState.isHalalEnum}" />
                                        <h:outputText style="font-weight: bold" value="#{bundle['branch.pricerange.label']}:" /> 
                                        <h:outputText value="#{localizedState.priceRangeEnum}" /> 
                                    </h:panelGrid>  
                                </p:rowExpansion> 


                            </p:dataTable>
                        </p:panel>
                    </center>


                </p:panel>





            </f:view>
        </h:form>
    </ui:define>
</ui:composition>
